<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <ul>

    </ul>
    <button>加载数据</button>
</body>
<script src="../jquery-3.6.0.min.js"></script>
<script type="module">
    import { ajax } from "./02request.js";

    

    $("button").on("click", function () {
        ajax($, "/stuHtml/01/05jquery/06ajax/userList.json").then(res => {
            console.log(res);

            let $ul = $("ul");

            res.result_data.forEach(v => {
                let obj = {};
                obj.name = v.name;
                obj.mobile = v.mobile;
                obj.age = v.age;

                let li = document.createElement("li");
                $(li).html(`<span>姓名：${obj.name}，年龄：${obj.age}</span>，电话：${obj.mobile}</span>`);

                $ul.append(li);
            })
            
        })
    });



</script>

</html>